<!DOCTYPE html>
<%@page import="java.util.List"%>
<%@page import="DTO.ObraDTO"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>42 books</title>
<link rel="stylesheet" type="text/css" href="../../livros/styles/styles.css" />
<script type="text/javascript" src="../../livros/js/view.js"></script>
<script type="text/javascript" src="../../livros/js/validacao.js"></script>
<jsp:useBean id="bean" class="SERVLET.HomeServlet" />
<body>

	<jsp:include page="pages/include/header.jsp"></jsp:include>

	
	<div id="conteudo">
		<div id="conteudoPagina">
			<div id="destaqueLivros">
				<div class="destaque">
					<h1>Melhor Avaliados</h1>
					
					<%
						List<ObraDTO> obras = bean.getObrasMelhoresAvaliadas();
						for (int i = 0; i < obras.size(); i++) {
					%>
					
						<div class="livroDestaque" onmouseover="show('descricao<%= i %>')" onmouseout="hide('descricao<%= i %>')" <%= "style=\"background: url(\'ObraServlet?acao=showImg&id=" + obras.get(i).getCodigo() + "') no-repeat; background-size: 100% 100%; border-radius: 8px; \"" %>>
							<div class="descricao" id="descricao<%= i %>" style="border-radius: 8px;">
								
								<textarea style="background: none; border: none; color: #fff; height: 100%; margin-left: -10px; overflow: auto; width: 90%" readonly="readonly" ><%= obras.get(i).getTitulo() + "\n" %><%= obras.get(i).getDescricao()  %></textarea>
							</div>
						</div>
					
					<% } %>
					
					
				</div>
				
				<div class="destaque">
					<h1>Mais Lidos</h1>
					
					<%
						obras = bean.getObrasMaisLidas();
						for (int i = 0; i < obras.size(); i++) {
					%>
					
						<div class="livroDestaque" onmouseover="show('descricaoLidos<%= i %>')" onmouseout="hide('descricaoLidos<%= i %>')" <%= "style=\"background: url(\'ObraServlet?acao=showImg&id=" + obras.get(i).getCodigo() + "') no-repeat; background-size: 100% 100%; border-radius: 8px \"" %>>
							<div class="descricao" id="descricaoLidos<%= i %>" style="border-radius: 8px" >
								<textarea style="background: none; border: none; color: #fff; height: 100%; margin-left: -10px; overflow: auto; width: 90%" readonly="readonly" ><%= obras.get(i).getTitulo() + "\n" %><%= obras.get(i).getDescricao()  %></textarea>
							</div>
						</div>
					
					<% } %>
				</div>
			</div>
		</div>
		
		<jsp:include page="pages/include/destaqueAutores.jsp"></jsp:include>
	</div>

</body>
</html>